<?php
	require_once('../auth.php');

?>

<html>
<head>
<script language="javascript">
location.replace("newsadmin.php")

</script>
</head>
<body>
		
<?php
 $sno = $_GET['sno'];
$con = mysql_connect("localhost","appma" ,"database");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

	mysql_select_db("162_appma", $con);

  $sql="SELECT * FROM news WHERE sno = ".$sno."";
 		 $result=mysql_query($sql);
		while($row = mysql_fetch_array($result))
		  {
            unlink($row['image']);	
            unlink("img/".$row['image']."");
		  
		  }

$update = mysql_query("DELETE FROM news WHERE sno = ".$sno."");
		if (!$update)
{
echo "not deleted";
}







	mysql_close($con);
?> 


</body>
  </html>                    
                 
